Skip to content

feat: add analytics heartbeat to iOS mobile app#808

Merged
datlechin merged 1 commit into
mainfrom
feat/analytics-mobile-heartbeat
Apr 21, 2026
Merged

feat: add analytics heartbeat to iOS mobile app#808
datlechin merged 1 commit into
mainfrom
feat/analytics-mobile-heartbeat

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • Create shared TableProAnalytics module in TableProCore with protocol-based dependency injection
  • Refactor macOS AnalyticsService from 164 lines to thin wrapper (32 lines) using shared service
  • Add analytics heartbeat to iOS mobile app with 20h cooldown for foreground/background cycles
  • Add SettingsView to mobile app with privacy toggle for analytics opt-out
  • macOS now sends platform: "macos", iOS sends platform: "ios" (backend PR Structure View Refactor & Keyboard Handling Migration #24 in license repo)

Architecture

  • AnalyticsEnvironmentProvider protocol — platform-specific data injection (IOKit/UIDevice, DatabaseManager/AppState)
  • AnalyticsHeartbeatService — shared: encoding, HMAC signing, HTTP transport, heartbeat loop, cooldown
  • MacAnalyticsProvider — macOS implementation
  • IOSAnalyticsProvider — iOS implementation with stable device ID (identifierForVendor + UserDefaults persistence)

Test plan

  • macOS builds successfully
  • iOS builds successfully (CODE_SIGNING_ALLOWED=NO)
  • Run macOS app → verify heartbeat in console log after 10s
  • Run iOS app in simulator → verify heartbeat fires
  • iOS Settings → toggle analytics off → verify heartbeat skips
  • iOS background/foreground → verify no duplicate heartbeats within 20h

@datlechin datlechin force-pushed the feat/analytics-mobile-heartbeat branch from 9022476 to ec56034 Compare April 21, 2026 12:28
@datlechin datlechin force-pushed the feat/analytics-mobile-heartbeat branch from ec56034 to a247bb9 Compare April 21, 2026 12:31
@datlechin datlechin merged commit 1babd37 into main Apr 21, 2026
1 check passed
@datlechin datlechin deleted the feat/analytics-mobile-heartbeat branch April 21, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant